// var url = "https://www.ccclkj.cn/zhensuo/sys/";
// var url = "http://192.168.110.68:2022/";
var path = "https://zbz-imgs.oss-cn-beijing.aliyuncs.com/";
var newUrl = "https://www.ccclkj.cn:2022/";
// var newUrl = "http://192.168.0.105:2022/";
var newUrl1 = "https://www.ccclkj.cn:2023/";
var newUrl2 = "https://www.ccclkj.cn:2025/";
var newUrl3 = "https://www.ccclkj.cn:2033/";
var picurl = "https://zbz-imgs.oss-cn-beijing.aliyuncs.com/OA/";

function re() {
	location.reload();
}

function popToTarget(targetId) {
	//获取目标页面
	var target = plus.webview.getWebviewById(targetId);
	if (!target) {
		console.log("目标页面不存在！");
		return;
	}
	//获取当前页面
	var current = plus.webview.currentWebview();
	if (current === target) {
		console.log("目标页面是当前页面！");
		return;
	}
	//将要关闭的页面
	var pages = new Array(current);
	//父级页面
	var opener = current.opener();
	while (opener) {
		if (opener === target) { //找到了目标页面
			//关闭目标页面的所有子级页面pages
			pages.map(function (page) {
				page.close();
			});
			return;
		}
		pages.push(opener);
		opener = opener.opener();
	}
	//没有找到目标页面
	console.log("目标页面不是当前页面的祖先页面！");
}
//  var page_id = plus.webview.currentWebview().id;
//	if(page_id=="main.html"||page_id=="geren.html"){
//	}else{
//plus.navigator.setStatusBarStyle("UIStatusBarStyleBlackOpaque");
//plus.navigator.setStatusBarStyle("dark");
//}

var pagesAll = ['HBuilder', 'tab-main.html', 'main.html', 'luntan.html', 'get_eggs.html', 'message.html', 'geren.html',
	'new_vip/vip_vipJinka.html'
];

function getAllPage() {
	var all = plus.webview.all();
	var arrs = [];
	var closePage = "";
	for (var z = 0; z < all.length; z++) {
		arrs[z] = all[z].id;
	}
	closePage = getArrDifference(arrs, pagesAll);
	for (var j = 0; j < closePage.length; j++) {
		if (closePage[j] == "HBuilder" || closePage[j] == "com.ccclkj.clinic") {
			continue;
		} else {
			plus.webview.getWebviewById(closePage[j]).close();
		}
	}
}

function getArrDifference(arr1, arr2) {
	return arr1.concat(arr2).filter(function (v, i, arr) {
		return arr.indexOf(v) === arr.lastIndexOf(v);
	});
}
